﻿@model MvcApplication6.Models.HomeModel
@using MvcApplication6.Models
@using MvcPaging
@using MvcApplication6.common
<div class="pr-head">
<span>
                        @*@Ajax.ActionLink(
                        "Sản Phẩm Khuyến mãi",
                        "Paging",
                        new
                        {
                            LevelMenu = 0,
                            Id = 0,
                            page = 1,
                            Flag = 2
                            
                        },
                        new AjaxOptions
                        {
                            HttpMethod = "GET",
                            InsertionMode = InsertionMode.Replace,
                            UpdateTargetId = "listProduct"
                        }
                        )*@

                        @*@Ajax.ActionLink(
                        "Sản Phẩm Khuyến mãi",
                        "Paging",
                        new
                        {
                            LevelMenu = 0,
                            Id = 0,
                            page = 1,
                            Flag = 2,
                            TitleMenu = "Sản Phẩm Khuyến mãi",
                            MenuId1 = 0,
                            MenuId2 = 0,
                            MenuId3 = 0
                        },
                        new AjaxOptions
                        {
                            HttpMethod = "GET",
                            InsertionMode = InsertionMode.Replace,
                            UpdateTargetId = "listProduct",
                            OnSuccess = "myonsuccessCallServer"
                        }
                        )*@
    <a href="/Home/GetProductByFlg2/Sản-Phẩm-Khuyến-mãi">Sản Phẩm Khuyến mãi</a>


</span>
</div>
    
<ul class="pr-list" id="list1">
   
        @foreach (var product in Model.ProductSalesListModel)
        {
        <li class="pr-item">
				@*@Ajax.ImageActionLink(
                                 "../../Upload/Images/" + @product.Image,
                                "",
                                 "ProductDetail",
                                new
                                {
                                    LevelMenu = @Model.LevelMenu,
                                    Id = @product.Id,
                                    MenuId1 = @Model.MenuId1,
                                    MenuId2 = @Model.MenuId2,
                                    MenuId3 = @Model.MenuId3
                                },
                                new AjaxOptions
                                {
                                    HttpMethod = "GET",
                                    InsertionMode = InsertionMode.Replace,
                                    UpdateTargetId = "listProduct"
                                },
                                   new { @class = "pr-img" }
                                )*@
               @*     <a href="@Url.Action("ProductDetail"
                                           , new
                                            {
                                                LevelMenu = @Model.LevelMenu,
                                                Ids = @product.Id,
                                                MenuId1 = @Model.MenuId1,
                                                MenuId2 = @Model.MenuId2,
                                                MenuId3 = @Model.MenuId3
                                            }
                                         )"
                    >
                        <img class = "pr-img" src="../../Upload/Images/@product.Image"/>
                    </a>*@

                    <a href="/Home/ProductDetail/1/@Model.LevelMenu/@product.Id/@Model.MenuId1/@Model.MenuId2/@Model.MenuId3/@product.Name">
                        <img class = "pr-img" src="http://aptechpro.vn/Upload/Images/@product.Image"/>
                    </a>


				                @*<div class="pr-img" style="background-image: url(../../Upload/Images/@product.Image)"></div>*@
                @if (@product.ProsalesFlag == 1)
                {
                    <div class="buy-tag">-@product.Sale%</div>
                }
                                
			<div class="pr-info">

                <span class="pr-name">@product.Name</span>
                                
				                
				<span class="pr-desc">Xuất xứ: @product.MakeIn </span>
                <span class="pr-desc">Bảo hành: @product.Warranty </span>
                @if (product.ProsalesFlag == 1 || @product.Sale > 0)
                    {
                            <span class="pr-desc" style="text-decoration: line-through;">Giá chính hãng @FormatStringNumber.FormatString(@product.Price.ToString()) </span>
                    }
                    else
                    {
                            <span class="pr-desc-red">@product.CallToSale</span>
                    }
				<span class="pr-price">
                        @*@Ajax.ActionLink(
                        "Giá:" + @FormatStringNumber.FormatString(((@product.Price * (100 - @product.Sale)) / 100).ToString()) + "VNĐ",
                        "ProductDetail",
                        new
                        {
                            LevelMenu = @Model.LevelMenu,
                            Id = @product.Id,
                            MenuId1 = 0,
                            MenuId2 = 0,
                            MenuId3 = 0
                        },
                        new AjaxOptions
                        {
                            HttpMethod = "GET",
                            InsertionMode = InsertionMode.Replace,
                            UpdateTargetId = "listProduct"
                        })*@
       @*          @Html.ActionLink("Giá:" + @FormatStringNumber.FormatString(((@product.Price * (100 - @product.Sale)) / 100).ToString()) + "VNĐ"
                                    , "ProductDetail"
                                    , new
                                        {
                                            LevelMenu = @Model.LevelMenu,
                                            Ids = @product.Id,
                                            MenuId1 = 0,
                                            MenuId2 = 0,
                                            MenuId3 = 0
                                        }
                                    , null)*@
                    
                     <a href="/Home/ProductDetail/1/@Model.LevelMenu/@product.Id/0/0/0/@product.Name">
                            Giảm còn: @FormatStringNumber.FormatString(((@product.Price * (100 - @product.Sale)) / 100).ToString()) VNĐ
                        </a>


                </span>
                   @* @if (Session["checkLoginAbcuser"] != null) { 
                            <a  href="Admin/AddProduct?ProductId=@product.Id" target="_blank">Sửa</a>
                                @Ajax.ActionLink(
                                    "Xóa",
                                    "DeleteProduct",
                                    new
                                    {
                                        Id = @product.Id,
                                        LevelMenu = @Model.LevelMenu,
                                        page = @Model.CurrentPage,
                                        IdCe = @Model.ProductId,
                                        TitleMenu = @Model.TitleMenu

                                    },
                                    new AjaxOptions
                                    {
                                        HttpMethod = "GET",
                                        InsertionMode = InsertionMode.Replace,
                                        UpdateTargetId = "listProduct",
                                        OnBegin = "myonbegin",
                                        OnSuccess = "myonsuccess",
                                        OnFailure = "myonfailure"
                                    }
                                    )     
                    }*@
                                 
                                
			</div>
		</li>
    
        }	
</ul>



